//
//  UIViewController+WhiteNavbar.m
//  CuriosityDaily3
//
//  Created by donghao on 16/9/23.
//  Copyright © 2016年 theBestTeam. All rights reserved.
//

#import "UIViewController+WhiteNavbar.h"

@implementation UIViewController (WhiteNavbar)

/**
 *  设置navBar的标题显示，而且为白色，
 *
 *  @param title 标题
 */
- (void)setNavBarWithTitle:(NSString *)title {
    self.title = title;
    self.navigationController.navigationBar.hidden = NO;
//    self.navigationController.navigationBar.alpha = 1;
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"navi_back"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:UIBarButtonItemStylePlain target:self action:@selector(back)];
}

#pragma mark - 返回按钮点击事件
- (void)back {
        [self.navigationController popViewControllerAnimated:YES];
//    [self dismissViewControllerAnimated:YES completion:nil];
}

@end
